home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Demo's / Igor Demo Pro / 1 PutContentsIn Igor Pro Folder / WaveMetrics Procedures / Graphing / Freeze Graph Size < prev    next >
Text File  |  1994-02-18  |  827b  |  23 lines

  1.  
  2. | This macro can freeze the top graph at its current size. This means that when
  3. | you use the graph in a page layout or when you print it will always be the current
  4. | size. This is useful in some cases to help get WYSIWYG results.  
  5. Macro FreezeGraphSize(doFreeze)
  6.     Variable doFreeze= 1
  7.     Prompt doFreeze,"action",popup "freeze;unfreeze"
  8.     
  9.     PauseUpdate; Silent 1
  10.     if( doFreeze==1 )
  11.         GetWindow kwTopWin,gsize
  12.         Variable gleft= V_left, gtop= V_top,gright= V_right,gbottom= V_bottom
  13.         GetWindow kwTopWin,psize
  14.         Variable pleft= V_left, ptop= V_top,pright= V_right,pbottom= V_bottom
  15.         ModifyGraph margin(left)=pleft-gleft,margin(top)=ptop-gtop
  16.         ModifyGraph margin(right)=gright-pright,margin(bottom)=gbottom-pbottom
  17.         ModifyGraph width=pright-pleft,height=pbottom-ptop
  18.     else
  19.         ModifyGraph margin=0,width=0,height=0
  20.     endif
  21. end
  22.